-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
botocore: Add DynamoDB extension #735
Conversation
* extract addtional DynamoDB specific attributes according to the spec * move DynamoDB tests to separate test module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor license comment only. Hey, it seems like you know botocore pretty well, interested in becoming a codeowner?
...y-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/dynamodb.py
Show resolved
Hide resolved
|
||
_OPERATION_MAPPING = { | ||
op.operation_name(): op | ||
for op in globals().values() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why use globals
and a series of if
s if the list of classes can be known beforehand? Is it expected that this module will receive more classes at runtime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the idea is to calculate it automatically so that operations that are added later (not at runtime) might not accidentally be forgotten to be added to the _OPERATION_MAPPING
added missing license info
i guess i could do that |
Description
Adds an extension to extract additional request/response attributes for DynamoDB as defined in the semantic conventions for the AWS SDK. Depending on which DynamoDB operation is called via the AWS SDK, different attributes are extracted.
To follow the database semantic conventions, relevant connection and call-level attributes are also extracted. Those attributes are:
db.system
: always 'dynamodb'db.operation
: corresponds to the called DynamoDB method/operation of the AWS SDKnet.peer.name
: basically corresponds to 'dynamodb..amazonaws.com'Removes the attribute
aws.table_name
as according to the AWS SDK spec,aws.dynamodb.table_names
should be used. (According to the spec the attribute is now also a list of table names instead of a single table name.)Type of change
How Has This Been Tested?
Adds additional unit tests to verify that DynamoDB related attributes are extracted accordingly
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.